Skip to content

fix(ui): make messages layout responsive#960

Open
Victor-root wants to merge 1 commit into
gotify:masterfrom
Victor-root:fix/messages-responsive-layout
Open

fix(ui): make messages layout responsive#960
Victor-root wants to merge 1 commit into
gotify:masterfrom
Victor-root:fix/messages-responsive-layout

Conversation

@Victor-root
Copy link
Copy Markdown

@Victor-root Victor-root commented May 12, 2026

✨ Summary

This improves the responsiveness of the WebUI Messages page.

The Messages page was previously constrained by the default DefaultPage width, which made the message list feel unnecessarily narrow on desktop screens and left a lot of available horizontal space unused.

This PR keeps the change scoped to the Messages page and preserves the existing layout for the other pages.

Fixes #744

🖥️ Desktop behavior

On larger desktop screens, the Messages page now uses more of the available horizontal space while still keeping a reasonable maximum width.

This makes long notifications, logs, Markdown content, and code blocks much easier to read without changing the overall Gotify layout.

🔧 Changes

  • Set a wider maxWidth only for the Messages page.
  • Size individual message cards based on their content.
  • Keep short text-only messages compact.
  • Allow messages with wide content, such as logs or code blocks, to expand up to the available page width.
  • Clamp <pre> blocks to the message card width while preserving internal horizontal scrolling.
  • Leave the other pages unchanged.

✅ Tested

I tested the change locally on:

  • 🖥️ Desktop
  • 💻 Laptop
  • 📱 Mobile web viewport

Everything works as expected:

  • the Messages page uses much more available width on desktop;
  • the layout remains clean on laptop/tablet-sized screens;
  • mobile web keeps message cards within the viewport while preserving code block horizontal scrolling;
  • the Android app is not affected;
  • existing messages, apps, clients, and WebSocket updates continue to work.

📸 Screenshots

Desktop :

image

Laptop :

laptop

Mobile web :

image

@Victor-root Victor-root requested a review from a team as a code owner May 12, 2026 15:57
Copy link
Copy Markdown
Member

@jmattheis jmattheis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution.

Comment thread ui/src/message/Message.tsx Outdated
Comment thread ui/src/message/Messages.tsx
Allow the Messages page to use more horizontal space while sizing individual message cards based on their content.

Short text messages keep the compact width, while messages with wide content such as code or log blocks can expand up to the available page width.

Keep preformatted content unwrapped with internal horizontal scrolling, matching the existing code block behavior.
@Victor-root Victor-root force-pushed the fix/messages-responsive-layout branch from 732b8e1 to 28b5a8a Compare May 15, 2026 15:53
@Victor-root
Copy link
Copy Markdown
Author

Victor-root commented May 15, 2026

Thanks for the review.

I updated the PR to keep <pre> content unwrapped with internal horizontal scrolling.

I also changed the message card sizing so short text-only messages keep the compact width, while wider content such as logs or code blocks can expand up to the available page width.

I retested it on desktop, laptop, and mobile web viewports.

Unrelated to this PR: would you be open to a separate PR adding an optional WebUI settings/preferences section?

The idea would be to keep all current defaults unchanged, but allow users to customize some UI preferences explicitly from the WebUI. For example, message layout/display preferences could live there instead of changing the default behavior for everyone.

I’m asking before working on it, since I’d rather avoid spending time on a larger UI change if this is not something you would want in Gotify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Request to add option to fill page or make reactive

2 participants